<div class="pages_btns">
	<div id="nav">
		<?=html::anchor('forum', '论坛首页')?> » <?=html::anchor('forum/category/'.$category->id.'/1', $category->title_cn)?> » <?=$topic->subject?>
	</div>
	<div class="threadflow postbtn"><?=html::anchor('forum/replytopic/'.$category->id.'/'.$topic->id, '回复主题')?> | <?=html::anchor('forum/newtopic/'.$category->id, '发新话题')?></div>
	<div class="threadflow">
		<?=($prev_topic->id) ? html::anchor('forum/topic/'.$prev_topic->category_id.'/'.$prev_topic->id.'/1', '&lsaquo;&lsaquo; 上一主题', 'title="'.$prev_topic->subject.'"') : '&lsaquo;&lsaquo; 上一主题'?> | 
		<?=($next_topic->id) ? html::anchor('forum/topic/'.$next_topic->category_id.'/'.$next_topic->id.'/1', '下一主题 &rsaquo;&rsaquo;', 'title="'.$next_topic->subject.'"') : '下一主题 &rsaquo;&rsaquo;'?>
	</div>
</div>

<?php $i=1; foreach($replies as $reply) { ?>
<div class="mainbox viewthread">
	<?php if($i==1) { ?><h1><?=$topic->subject?></h1><?php } ?>
	<table id="pid1" summary="pid1" cellspacing="0" cellpadding="0"><tr>
		<td class="postauthor">
			<cite><a href="" id="userinfo1" class="dropmenu"><?=$reply->author?></a></cite>
		</td>
		<td class="postcontent" >
			<div class="postinfo">
				<strong><?=$i?><sup>#</sup></strong>
				发表于 <?=substr($reply->updated_at, 0, 16)?>&nbsp;
			</div>
			<div class="postmessage defaultpost">
				<h2><?=$reply->subject?></h2>
				<div id="postmessage_1" class="t_msgfont"><?=$reply->message?></div>
				<?php if($reply->photo != '') { ?><div style="padding-top:20px;">图片：<br/><?=html::image('photo/forum/770/'.$reply->photo)?></div><?php } ?>
			</div>
		</td>
	</tr><tr>
		<td class="postauthor"> </td>
		<td class="postcontent">
			<div class="postactions">
				<p><strong onclick="scroll(0,0)" title="顶部">TOP</strong></p>
			</div>
		</td>
	</tr></table>
</div>
<?php $i++; } ?>

<div class="pages_btns" style="margin-top:-10px;">
	<?=$this->pagination?>
	<div class="threadflow postbtn"><?=html::anchor('forum/replytopic/'.$category->id.'/'.$topic->id, '回复主题')?> | <?=html::anchor('forum/newtopic/'.$category->id, '发新话题')?></div>
	<div class="threadflow">
		<?=($prev_topic->id) ? html::anchor('forum/topic/'.$prev_topic->category_id.'/'.$prev_topic->id.'/1', '&lsaquo;&lsaquo; 上一主题', 'title="'.$prev_topic->subject.'"') : '&lsaquo;&lsaquo; 上一主题'?> | 
		<?=($next_topic->id) ? html::anchor('forum/topic/'.$next_topic->category_id.'/'.$next_topic->id.'/1', '下一主题 &rsaquo;&rsaquo;', 'title="'.$next_topic->subject.'"') : '下一主题 &rsaquo;&rsaquo;'?>
	</div>
</div>

<?php if( cookie::get('username') != '' ) { ?>
<form method="post" action="/forum/savereply/<?=$category->id?>/<?=$topic->id?>" onsubmit="return Validator.Validate(this,2)">
<div class="box" id="quickpost">
	<h4>快速回复主题</h4>
	<table><tr>
		<td width="100"><label for="subject">标题</label></td>
		<td><input type="text" tabindex="1" size="120" name="subject" id="subject"/> [选项]</td>
	</tr><tr>
		<td valign="top"><label>内容</label></td>
		<td><textarea tabindex="2" id="message" name="message" class="autosave" cols="150" rows="7" dataType="Require" msg="请输入主题内容"></textarea></td>
	</tr><tr>
		<td> </td>
		<td><input tabindex="3" id="postsubmit" name="topicsubmit" type="submit" value="发表帖子"/></td>
	</tr></table>
</div>
</form>
<?php } ?>